home *** CD-ROM | disk | FTP | other *** search
/ Aminet 48 / Aminet 48 (2002)(GTI - Schatztruhe)[!][Apr 2002].iso / Aminet / text / edit / vim60rt.lha / Vim / vim60 / syntax / bdf.vim < prev    next >
Encoding:
Text File  |  2001-07-24  |  2.8 KB  |  83 lines

  1. "  vim: set sw=4 sts=4:
  2. "  Maintainer    : Nikolai 'pcp' Weibull <da.box@home.se>
  3. "  Revised on    : Tue, 24 Jul 2001 18:54:16 CEST
  4. "  Language    : BDF Font definition
  5.  
  6. if version < 600
  7.     syntax clear
  8. elseif exists("b:current_syntax")
  9.     finish
  10. endif
  11.  
  12. " comments
  13. syn region  bdfComment        start="^COMMENT\>" end="$" contains=bdfTodo
  14.  
  15. " todo
  16. syn keyword bdfTodo        contained TODO
  17.  
  18. " numbers
  19. syn match   bdfNumber        display "\<\(\x\+\|\d\+\.\d\+\)"
  20.  
  21. " strings
  22. syn region  bdfString        start=+"+ skip=+""+ end=+"+
  23.  
  24. " properties
  25. syn keyword bdfProperties   contained FONT SIZE FONTBOUNDINGBOX CHARS
  26.  
  27. " X11 properties
  28. syn keyword bdfXProperties  contained FONT_ASCENT FONT_DESCENT DEFAULT_CHAR
  29. syn keyword bdfXProperties  contained FONTNAME_REGISTRY FOUNDRY FAMILY_NAME
  30. syn keyword bdfXProperties  contained WEIGHT_NAME SLANT SETWIDTH_NAME PIXEL_SIZE
  31. syn keyword bdfXProperties  contained POINT_SIZE RESOLUTION_X RESOLUTION_Y SPACING
  32. syn keyword bdfXProperties  contained CHARSET_REGISTRY CHARSET_ENCODING COPYRIGHT
  33. syn keyword bdfXProperties  contained ADD_STYLE_NAME WEIGHT RESOLUTION X_HEIGHT
  34. syn keyword bdfXProperties  contained QUAD_WIDTH FONT AVERAGE_WIDTH
  35.  
  36. syn region  bdfDefinition   transparent matchgroup=bdfDelim start="^STARTPROPERTIES\>" end="^ENDPROPERTIES\>" contains=bdfXProperties,bdfNumber,bdfString
  37.  
  38. " characters
  39. syn keyword bdfCharProperties contained ENCODING SWIDTH DWIDTH BBX ATTRIBUTES BITMAP
  40.  
  41. syn match   bdfCharName        contained display "\<[0-9a-zA-Z]\{1,14}\>"
  42. syn match   bdfCharNameError contained display "\<[0-9a-zA-Z]\{15,}\>"
  43.  
  44. syn region  bdfStartChar    transparent matchgroup=bdfDelim start="\<STARTCHAR\>" end="$" contains=bdfCharName,bdfCharNameError
  45.  
  46. syn region  bdfCharDefinition transparent start="^STARTCHAR\>" matchgroup=bdfDelim end="^ENDCHAR\>" contains=bdfCharProperties,bdfNumber,bdfStartChar
  47.  
  48. " font
  49. syn region  bdfFontDefinition transparent matchgroup=bdfDelim start="^STARTFONT\>" end="^ENDFONT\>" contains=bdfProperties,bdfDefinition,bdfCharDefinition,bdfNumber,bdfComment
  50.  
  51. if exists("bdf_minlines")
  52.     let b:bdf_minlines = bdf_minlines
  53. else
  54.     let b:bdf_minlines = 50
  55. endif
  56. exec "syn sync minlines=" . b:bdf_minlines
  57.  
  58. " Define the default highlighting.
  59. " For version 5.7 and earlier: only when not done already
  60. " For version 5.8 and later: only when an item doesn't have highlighting yet
  61. if version >= 508 || !exists("did_bdf_syn_inits")
  62.     if version < 508
  63.     let did_bdf_syn_inits = 1
  64.     command -nargs=+ HiLink hi link <args>
  65.     else
  66.     command -nargs=+ HiLink hi def link <args>
  67.     endif
  68.  
  69.     HiLink bdfComment        Comment
  70.     HiLink bdfTodo        Todo
  71.     HiLink bdfNumber        Number
  72.     HiLink bdfString        String
  73.     HiLink bdfProperties    Keyword
  74.     HiLink bdfXProperties    Keyword
  75.     HiLink bdfCharProperties    Structure
  76.     HiLink bdfDelim        Delimiter
  77.     HiLink bdfCharName        String
  78.     HiLink bdfCharNameError    Error
  79.     delcommand HiLink
  80. endif
  81.  
  82. let b:current_syntax = "bdf"
  83.